home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F40816_roundLog2.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2002-02-06  |  614 b   |  23 lines

  1. <xsl:stylesheet version="1.0" 
  2. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:lxslt="http://xml.apache.org/xslt"
  4. xmlns:roundLog2="roundLog2"
  5. extension-element-prefixes="roundLog2"
  6. >
  7.   <xsl:template name="roundLog2">
  8.     <xsl:param name="pX"/>
  9.     <xsl:value-of select="roundLog2:roundLog2(string($pX))"/>
  10.   </xsl:template>
  11.   
  12.  
  13.   <lxslt:component prefix="roundLog2" functions="roundLog2">
  14.     <lxslt:script lang="javascript">
  15.        function roundLog2(x)
  16.        {
  17.           return Math.round(Math.log(x)/Math.LN2);
  18.        }
  19.     </lxslt:script>
  20.   </lxslt:component>
  21. </xsl:stylesheet>
  22.  
  23.